Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not call HTMLParser.unescape() in Python 3.9 in six #12540

Closed
wants to merge 1 commit into from

Conversation

radarhere
Copy link
Contributor

Presumably, #11419 will be resolved at some point in the future by upgrading the base image to Python > 3.8. Maybe by #11420, maybe by #12027, maybe by a PR that has yet to be created.

When that happens, 'six' will have a problem.

six.moves.html_parser.HTMLParser().unescape(
fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 1024)))

In Python 3.9, 'unescape' was removed from HTMLParser - https://docs.python.org/3/whatsnew/3.9.html#porting-to-python-3-9

The unescape() method in the html.parser.HTMLParser class has been removed (it was deprecated since Python 3.4).

Looking at the 'six' source code, unescape isn't actually called by anything internally. HTMLParser is sure, but that's it. So if the method is gone in Python >= 3.9, then there's no need to continue testing it when Python is upgraded.

Copy link

radarhere is a new contributor to projects/six. The PR must be approved by known contributors before it can be merged.

Copy link
Collaborator

@DavidKorczynski DavidKorczynski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not do this one now, because when the Python upgrade happens we want to do it but excluding the if statement. The fuzzer doesn't need the if in general

@radarhere radarhere closed this Oct 1, 2024
@radarhere radarhere deleted the six branch October 1, 2024 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants